package com.ruoyi.product.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.product.mapper.ProCommentMapper;
import com.ruoyi.product.domain.ProComment;
import com.ruoyi.product.service.IProCommentService;

/**
 * 商品评论Service业务层处理
 * 
 * @author admin
 * @date 2023-10-13
 */
@Service
public class ProCommentServiceImpl implements IProCommentService 
{
    @Autowired
    private ProCommentMapper proCommentMapper;

    /**
     * 查询商品评论
     * 
     * @param id 商品评论主键
     * @return 商品评论
     */
    @Override
    public ProComment selectProCommentById(Long id)
    {
        return proCommentMapper.selectProCommentById(id);
    }

    /**
     * 查询商品评论列表
     * 
     * @param proComment 商品评论
     * @return 商品评论
     */
    @Override
    public List<ProComment> selectProCommentList(ProComment proComment)
    {
        return proCommentMapper.selectProCommentList(proComment);
    }

    /**
     * 新增商品评论
     * 
     * @param proComment 商品评论
     * @return 结果
     */
    @Override
    public int insertProComment(ProComment proComment)
    {
        proComment.setCreateTime(DateUtils.getNowDate());
        return proCommentMapper.insertProComment(proComment);
    }

    /**
     * 修改商品评论
     * 
     * @param proComment 商品评论
     * @return 结果
     */
    @Override
    public int updateProComment(ProComment proComment)
    {
        proComment.setUpdateTime(DateUtils.getNowDate());
        return proCommentMapper.updateProComment(proComment);
    }

    /**
     * 批量删除商品评论
     * 
     * @param ids 需要删除的商品评论主键
     * @return 结果
     */
    @Override
    public int deleteProCommentByIds(Long[] ids)
    {
        return proCommentMapper.deleteProCommentByIds(ids);
    }

    /**
     * 删除商品评论信息
     * 
     * @param id 商品评论主键
     * @return 结果
     */
    @Override
    public int deleteProCommentById(Long id)
    {
        return proCommentMapper.deleteProCommentById(id);
    }
}
